/*
 * Project : Linuxbox
 * File    : UserManEdit.java
 * Version : 1.0
 * Author  : Kevin Zhang
 *
 * Copyright (c) 2000-2001 by Linuxbox, Inc.
 * All rights reserved.
 */
package linuxbox.download.servlet;

import javax.servlet.http.*;

import linuxbox.common.*;
import linuxbox.download.logic.*;
import linuxbox.download.bean.*;

public class DlCatEditAction extends Action {
	protected static final String DL_CAT_ID_PARAM = "DL_CAT_ID";         
	protected static final String DL_CAT_NAME_PARAM = "DL_CAT_NAME";
	protected static final String DL_CAT_DIR_PARAM = "DL_CAT_DIR";
	protected static final String DL_CAT_DESC_PARAM = "DL_CAT_DESC";

	protected static String successJSP = null;
	
    public void doAction(HttpSession aSession, BoxSession aBoxSession, 
    HttpServletRequest req, HttpServletResponse res) throws Exception {
		int DlCatID = Integer.parseInt(req.getParameter(DL_CAT_ID_PARAM));
	
		DownLoadManager dlm = DownLoadManager.getInstance();
		DlCatKey key = new DlCatKey(DlCatID);
		DlCatObject dlco = dlm.getDlCat(key);

		req.setAttribute(DL_CAT_ID_PARAM, Integer.toString(dlco.getID()));
		req.setAttribute(DL_CAT_NAME_PARAM, dlco.getName());
		req.setAttribute(DL_CAT_DIR_PARAM, dlco.getDir());
		req.setAttribute(DL_CAT_DESC_PARAM, dlco.getDesc());

		sendFile(successJSP, req, res);
	}

	public void setSuccessJSP(String str) {
		successJSP = str;
	}
}
